
{{-- 继承布局模板 --}}
@extends( 'mofa.layouts.main-layout' )


{{--  当前页面的样式表 --}}
@section('style')
    <link rel="stylesheet" type="text/css" href="{{ asset('mofa/css/dynamic.css') }}">
@endsection()


{{-- 插入标题 --}}
@section('title')
    <title>企业动态 -广州魔发科技有限公司,发型虚拟试戴</title>
@endsection


@section('content')
    <section class="banner">


    </section>

    <!-- 企业动态 -->
    <section class="dynamic" id="dynamic" >

        <div class="bym-wrapper clearfix">

            <dl class="dynamic-nav bym-not-list">
                <dd :class="[newsTagId == 1 ? 'active': '']" @click="changeTag(1)" > 企业动态 </dd>

                <dd  v-for="item in newsTags"
                     :key="item.id" v-text="item.name"
                     @click="changeTag(item.id)"
                     :class="[newsTagId == item.id ? 'active': '']">

                </dd>
            </dl>

                <ul v-show="!loading" class="dynamic-contents bym-not-list">
                    <li class="dynamic-content-item clearfix" v-for="article in articles">
                        <div class="item-cover">
                            <img :src="article.company_thumb" alt="">
                        </div>
                        <h4 class="item-title" v-text="article.title"></h4>
                        <p class="item-desc" v-text="article.description"></p>
                        <a href="" class="item-more" :href="'news/detail/'+article.id">阅读更多》</a>
                    </li>
                </ul>



             <div class="dynamic-loading-info" v-show="loading">正在加载...</div>
             <div class="dynamic-loading-info" v-show="!loading && !articles.length">没有内容</div>

        </div>

        {{--分页--}}
        <bym-pagination v-if="articles.length && !loading" v-on:change-page="changePage"
                        :total=paginate.last_page
                        :current="paginate.current_page"
                        :next="paginate.next_page_url"
                        :perv="paginate.prev_page_url"
        ></bym-pagination>

    </section>
    <!-- 企业动态 end -->


    <script type="text/x-template" id="bym_pagination" >
        <ul class="bym-pagination">

            <li class="prev" v-show="current > 1"><a  href="javascript:;"  @click="clickHandle(current-1)">上一页</a></li>
            {{--<li class="prev" v-else><a  href="javascript:;" class="disable">上一页</a></li>--}}
            <li v-for="index in pageList" >
                <template v-if="typeof index === 'number'" >
                    <a href="javascript:;" v-text="index" @click="clickHandle(index)" :class="[index === current ? 'active' :'']"></a>
                </template>
                <template v-else>
                    <a v-text="index" class="disable"></a>
                </template>
            </li>
            <li class="next" v-show="current < total"><a href="javascript:;" @click="clickHandle(current+1)" >下一页</a></li>
            {{--<li class="next" v-else><a href="javascript:;" class="disable" >下一页</a></li>--}}
        </ul>
    </script>


@endsection

@section('script')
    <script type="text/javascript" src="{{asset('version-2017/js/pagination.js')}}"></script>
    <script type="text/javascript" src="{{asset('mofa/js/dynamic.js')}}"></script>
@endsection
